package operation;

import book.Book;
import book.BookList;

//退出系统
public class ExitBook implements IOperation{
    @Override
    public void work(BookList books) {
        System.out.println("退出系统————");
        int currentSize=books.getUsedSize();
        for (int i = 0; i <currentSize ; i++) {//退出系统，将内存回收一下
            books.setBook(i,null);
        }
        books.setUsedSize(0);
        System.out.println("已退出图书系统");
        System.exit(0);//0代表正常退出
    }
}
